﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.facebook.session {
    import flash.events.*;
    import com.facebook.*;
    import com.facebook.events.*;
    import com.facebook.delegates.*;
    import com.facebook.net.*;

    public class WebSession extends EventDispatcher implements IFacebookSession {

        public static const VIDEO_URL:String = "http://api-video.facebook.com/restserver.php";
        public static const REST_URL:String = "http://api.facebook.com/restserver.php";

        facebook_internal var _uid:String;
        protected var _is_connected:Boolean = false;
        public var login_url:String = "http://www.facebook.com/login.php";
        protected var _secret:String;
        protected var _rest_url:String = "http://api.facebook.com/restserver.php";
        protected var _api_version:String = "1.0";
        protected var _expires:Date;
        protected var _session_key:String;
        protected var _api_key:String;

        public function WebSession(_arg1:String, _arg2:String, _arg3:String=null){
            this._api_key = _arg1;
            this._session_key = _arg3;
            this.secret = _arg2;
        }
        public function get waiting_for_login():Boolean{
            return (false);
        }
        public function get rest_url():String{
            return (this._rest_url);
        }
        public function set rest_url(_arg1:String):void{
            this._rest_url = _arg1;
        }
        public function post(_arg1:FacebookCall):IFacebookCallDelegate{
            this.rest_url = REST_URL;
            if ((_arg1 is IUploadPhoto)){
                return (new WebImageUploadDelegate(_arg1, this));
            };
            if ((_arg1 is IUploadVideo)){
                this.rest_url = VIDEO_URL;
                return (new VideoUploadDelegate(_arg1, this));
            };
            return (new WebDelegate(_arg1, this));
        }
        public function get secret():String{
            return (this._secret);
        }
        public function get expires():Date{
            return (this._expires);
        }
        public function get api_key():String{
            return (this._api_key);
        }
        public function refreshSession():void{
        }
        public function get session_key():String{
            return (this._session_key);
        }
        public function get uid():String{
            return (facebook_internal::_uid);
        }
        public function get api_version():String{
            return (this._api_version);
        }
        public function get is_connected():Boolean{
            return (this._is_connected);
        }
        public function set secret(_arg1:String):void{
            this._secret = _arg1;
        }
        public function verifySession():void{
            if (this._session_key){
                this._is_connected = true;
                dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, true));
            } else {
                this._is_connected = false;
                dispatchEvent(new FacebookEvent(FacebookEvent.CONNECT, false, false, false));
            };
        }
        public function set api_version(_arg1:String):void{
            this._api_version = _arg1;
        }
        public function login(_arg1:Boolean):void{
        }
        public function set session_key(_arg1:String):void{
            this._session_key = _arg1;
        }

    }
}//package com.facebook.session 
